<?php
include $_SERVER['DOCUMENT_ROOT'] . '/paths.php';
include $COMPONENT_NAVBAR;

function getDefaultHeader($title)
{
  $header = '
      <head>
      <meta charset="US-ASCII">
      <title>' . $title . '</title>
      <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">
      <link rel="stylesheet" href="/prettify/prettify.css">
      <link rel="stylesheet" href="/custom.css">
      <script src="https://code.jquery.com/jquery.js" type="text/javascript"></script>
      <script src="/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
      <script src="/prettify/prettify.js" type="text/javascript"></script>
      </head>
    ';
  
  return $header;
}

function getDefaultBody($navbar_active, $jumbo, $sidebar, $content)
{
  $body = '
      <body onload="prettyPrint()">
        
        ' . getNavBar($navbar_active) . '
       
        <div class="container">
          <div id="jumbo">
            <div class="jumbotron">
              ' . $jumbo . '
            </div>
          </div>
          <div class="row">
            <div class="col-md-3">
              ' . $sidebar . '
            </div>
            <div class="col-md-9" id="content">
              ' . $content . '
            </div>
          </div>
        </div>
      </body>
    ';
  return $body;
}

function getDefaultAffixScript()
{
  $script = '
      <script>
        $("body").css("margin-top", $("nav").outerHeight(true));
        $("#sidebar").affix({
          offset: {
            top: $("#jumbo").outerHeight(true) + 
                parseInt($("nav").css("margin-bottom"), 10)
          }
        });
        $(".anchor").css("height", $("nav").outerHeight(true));
        $(".anchor").css("margin-top", -$("nav").outerHeight(true));
      </script>
    ';
  
  return $script;
}
?>
